
float4 DelayBloom_ps(uniform sampler2D current_b : register(s0),
			uniform sampler2D target_b : register(s1),
			uniform float time
			): COLOR0
{
	float2 uv={0,0};
	float4 tar_b=tex2D(target_b ,uv);
	float4 cur_b=tex2D(current_b ,uv );
	//float bt=(0.27*tar_b.r+0.67*tar_b.g+0.06*tar_b.b);
	float bt=length(tar_b.rgb)/1.5;
	float bc=cur_b.r;
	float next=bt-bc;
	float h=0.3*time;
	float h2=-0.1*time;
	if(next>h) next=h;
	if(next<h2) next=h2;
	tar_b.r=clamp(0,0.89,bc+next);
	tar_b.g=0;
	tar_b.b=0;
	return tar_b;
}


float4 InitialBloom_ps(): COLOR0
{
	float4 t_b={0,0,0,1};
	return t_b;
}


